<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCaseInvoicesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('case_invoices', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('case_case_id')->comment('所属案件');
            $table->integer('state')->comment('发票状态');
            $table->decimal('money')->comment('开票金额');
            $table->integer('type')->comment('开票类型');
            $table->integer('title_type')->comment('抬头类型');
            $table->string('title')->default('')->comment('抬头名称');
            $table->string('tin')->nullable()->comment('纳税人识别号');
            $table->string('bank_name')->nullable()->comment('开户行');
            $table->string('bank_account')->nullable()->comment('开户账号');
            $table->string('address')->nullable()->comment('开票地址');
            $table->char('phone')->nullable()->comment('电话');
            $table->string('contact_name')->nullable()->comment('联系人');
            $table->char('contact_phone')->nullable()->comment('联系电话');
            $table->string('contact_address')->nullable()->comment('邮寄地址');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('case_invoices');
    }
}
